Add find waypt by name.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 5 Nov 2002 06:13:28 +0000 (06:13 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 5 Nov 2002 06:13:28 +0000 (06:13 +0000)
gpsbabel/waypt.c

index ea477ab533ac6eddf50a568c3cd3e0f723f49929..6782978477e7031d989b2af268a882d48a297cd5 100644 (file)
@@ -77,3 +77,19 @@ waypt_disp_all(waypt_cb cb)
                (*cb) (waypointp);
        }
 }
+
+waypoint *
+find_waypt_by_name(const char *name)
+{
+       queue *elem, *tmp;
+       waypoint *waypointp;
+
+       QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
+               waypointp = (waypoint *) elem;
+               if (0 == strcmp(waypointp->shortname, name)) {
+                       return waypointp;
+               }
+       }
+
+       return NULL;
+}